package com.erji.common.cos;

import com.erji.common.cos.domain.FileObject;
import com.qcloud.cos.model.ObjectMetadata;

import java.io.InputStream;

public interface FileManager {
    FileObject upload(String objectKey, InputStream inputStream);

    FileObject upload(String objectKey, InputStream inputStream, ObjectMetadata metadata);

    FileObject upload(String fileName, String objectKey, InputStream inputStream, int expiredMilliseconds);

    FileObject upload(String fileName, String objectKey, InputStream inputStream, ObjectMetadata metadata, int expiredMilliseconds);

    boolean checkExist(String objKey);

    void remove(String objKey);

    void rename(FileObject fileObject, String targetObjKey);

    void rename(FileObject f, String targetObjKey, int expiredMilliseconds);

    String generateUrl(String objectKey);

    String generateUrl(String objectKey, int expiredMilliseconds);

    ObjectMetadata getObjectMetadata(String objectKey);

    void updateFolder(FileObject fileObject, String sourceFolder, String targetFolder);

    void updateFolder(FileObject fileObject, String sourceFolder, String targetFolder, int expiredMilliseconds);
}
